package main

import "fmt"

func initM1() {
	var map1 map[string]string
	fmt.Println(map1)
	fmt.Println(map1 == nil)
	//panic: assignment to entry in nil map
	//map1["a"] ="A"
	//fmt.Println(map1)
}

func initM2() {
	var map1 = make(map[string]string)
	fmt.Println(map1 == nil)
	map1["a"] = "A"
	fmt.Println(map1)
}

func initM3() {
	map1 := map[string]string{}
	fmt.Println(map1)
	fmt.Println(map1 == nil)
	map1["a"] = "A"
}

func initM4() {
	map1 := map[string]string{
		"a": "A",
	}
	fmt.Println(map1)
}

func main() {
	initM1()
	fmt.Println("===================")
	initM2()
	fmt.Println("===================")
	initM3()
	fmt.Println("===================")
	initM4()
}
